﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Mammoth.Events;

namespace Mammoth.Services
{
    public partial class GTalkService
    {
        private void OnAccountListChange(string serviceEmail)
        {
            if (AccountListChange != null)
                AccountListChange(this, new EventArgs());
        }

        private void OnLogout(string serviceEmail)
        {
            if (Logout != null)
                Logout(this, new ServiceEventArgs(serviceEmail));
        }

        private void OnLogin(string serviceEmail)
        {
            if (Login != null)
                Login(this, new ServiceEventArgs(serviceEmail));
        }

        private void OnFriendListLoad(string serviceEmail)
        {
            if (FriendListLoad != null)
                FriendListLoad(this, new ServiceEventArgs(serviceEmail));
        }

        private void OnError(string serviceEmail, ServiceErrorType error)
        {
            if (Error != null)
                Error(this, new ServiceErrorEventArgs(serviceEmail, error));
        }

        private void OnMessage(string serviceEmail, string buddyEmail, string msg)
        {
            if (Message != null)
                Message(this, new ServiceMessageEventArgs(serviceEmail, buddyEmail, msg));
        }

        private void OnSubscriptionRequest(string serviceEmail, string buddyEmail)
        {
            if (SubscriptionRequest != null)
                SubscriptionRequest(this, new SubscriptionRequestEventArgs(serviceEmail, buddyEmail));
        }
    }
}
